home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / IFF / Old_IFF_Packages / November_1988 / Documents / Readme.doc < prev   
Encoding:
Text File  |  1989-02-23  |  6.9 KB  |  176 lines

  1.       Overview of IFF example source files
  2.             Feb. 4, 1986
  3.  
  4.  
  5. This source code is distributed as public domain software.
  6. Use it to help write robust IFF-compatible programs.
  7.  
  8. Caveat: Electronic Arts developed this code, and is releasing it to
  9. promote the success of the Amiga.  EA does not have the resources 
  10. to supply support for this code.
  11.  
  12. For support, Amiga software developers contact Commodore directly.
  13.  
  14.  
  15. 1. Files
  16.  
  17.    README  .DOC   This document.
  18.    BACKGRND.DOC   Tutorial on some techniques used in these example
  19.          programs.
  20.  
  21.    COMPILER.H   Portability file to isolate compiler idiosyncrasies.
  22.  
  23.    INTUALL .H   A super-include file for Amiga include files.
  24.  
  25.    REMALLOC.H   Header for RemAlloc subroutines.
  26.    REMALLOC.C   Memory ALLOCators which REMember the size allocated,
  27.          for simpler freeing.
  28.  
  29.    GIO     .H   Header file for Generic I/O speed up package.
  30.    GIO     .C   Generic I/O speed up routines (a disk cache).
  31.    GIOCALL .C   Outline of example GIO client.
  32.       To turn on the GIO package, change a switch in GIO.H,
  33.       add GIO.O to the linker control file, and recompile.
  34.  
  35.    IFF     .H     Header file for general IFF read/write support.
  36.    IFFR    .C     IFF reade support routines.
  37.    IFFW    .C     IFF writer support routines.
  38.       These routines do a lot of the work for reading and writing
  39.       IFF files robustly. The reader and writer are separate since
  40.       some programs don't need both.
  41.  
  42.    IFFCHECK.C     IFF checker utility source (very handy for debugging).
  43.    IFFCHECK.LNK   IFF checker utility linker control file.
  44.    IFFCHECK       Amiga runnable object program.
  45.       The IFF checker scans an IFF file, checks it for syntax
  46.       errors, and prints an outline of its contents.
  47.  
  48.    PACKER  .H     Header for byte run encoder (compressor) subroutines.
  49.    PACKER  .C     Run encoder subroutines.
  50.    UNPACKER.C     Run decoder subroutines.
  51.       This run encoder/decoder is used for ILBM raster images.
  52.  
  53.    ILBM    .H     Header for ILBM (raster image file) subroutines.
  54.    ILBMR   .C     ILBM reader support routines. Uses IFFR.
  55.    ILBMW   .C     ILBM writer support routines. Uses IFFW.
  56.  
  57.    READPICT.H   Header for ReadPicture subroutines.
  58.    READPICT.C   ReadPicture subroutines read an ILBM file into an
  59.          Amiga BitMap in RAM. Uses ILBMR and IFFR.
  60.  
  61.    SHOWILBM.C     Example program that reads and displays an ILBM file.
  62.    SHOWILBM.LNK   Linker control file for ShowILBM program.
  63.    SHOWILBM       Amiga runnable object program ShowILBM.
  64.    SHOWILBM.INFO   So you can run ShowILBM under the Amiga workbench.
  65.  
  66.    PUTPICT .H   Header for PutPict subroutines.
  67.    PUTPICT .C   PutPict subroutines write an Amiga BitMap from RAM
  68.          to an ILBM file. Uses ILBMW and IFFW.
  69.  
  70.    RAW2ILBM.C     Example program that reads a "raw" raster image file
  71.          and writes the image as an ILBM file.
  72.    RAW2ILBM.LNK   Linker control file for Raw2ILBM.
  73.    RAW2ILBM   Amiga runnable object program.
  74.  
  75.    ILBM2Raw.C     Example program that reads an image as an ILBM file
  76.          and writes the image as a "raw" raster image file.
  77.    ILBM2Raw.LNK   Linker control file for ILBM2Raw.
  78.    ILBM2Raw   Amiga runnable object program.
  79.  
  80.    BMPrintC.C   Subroutine that actually does the text dump.
  81.    ILBMDump.C     Example program that reads an image as an ILBM file
  82.          and writes the image as a text file containing
  83.          C data initialization statements for either a
  84.          BOB or a Sprite.
  85.    ILBMDump.LNK   Linker control file for ILBMDump.
  86.    ILBMDump   Amiga runnable object program.
  87.  
  88.    ZapIcon      Amiga runnable program that creates a tool icon from
  89.          an ILBM (i.e., a brush saved from DPaint).
  90.          Usage: zapicon brushname toolname
  91.  
  92.    IFFCHECG.LNK   Link file for IFFCheck including GIO.
  93.    SHOWILBG.LNK   Link file for ShowILBM including GIO.
  94.    RAW2ILBG.LNK   Link file for Raw2ILBM including GIO.
  95.  
  96.  
  97.    dragon      A picture of a dragon (ILBM brush).
  98.                Can be converted to an icon using Zapicon, or to C
  99.                   source using ILBMDump.
  100.  
  101.  
  102. 2. About the development environment.
  103.  
  104. This source code is built for the Lattice 68000 C cross-compiler from the
  105. IBM PC and the MetaComCo Amiga linker. You may have to make changes to suit
  106. other development tools, another development machine, or another target
  107. machine.
  108.  
  109. These programs use C header files supplied by Commodore for the Amiga
  110. computer. If you need them, contact Commodore. Dependencies on the runtime
  111. environment are pretty localized, so ports should be easy.
  112.  
  113.  
  114. If you don't have Commodore's EXEC/TYPES.H file, here are some global IFF
  115. definitions you'll need:
  116.  
  117. typedef long      LONG;       /* signed   32-bit number */
  118. typedef unsigned long   ULONG;       /* unsigned 32-bit number */
  119. typedef short      WORD;       /* signed   16-bit number */
  120. typedef unsigned short   UWORD;       /* unsigned 16-bit number */
  121. typedef char      BYTE;       /* signed    8-bit number */
  122. typedef unsigned char   UBYTE;       /* unsigned  8-bit number */
  123. typedef short      BOOL;
  124. #define NULL      0
  125.  
  126.  
  127. 3. Compiler ideosyncracies.
  128.  
  129. The Lattice C compiler running on the IBM PC supports a recent addition to
  130. the C language: the ability to typecheck procedure arguments (templates).
  131. Believe me, typechecking is useful! The more bugs I find at compile time,
  132. the less I have to find at run time.
  133.  
  134. The programmer asks for typechecking via an "extern" statement like this:
  135.    extern IFFP Seek(BPTR, LONG, LONG);
  136. or a "typedef" statement like this:
  137.    typedef IFFP ClientProc(struct _GroupContext *);
  138.  
  139. Unfortunately, this chokes other C compilers. If you have such a compiler,
  140. you have to comment out the stuff in parentheses. The above two examples
  141. become:
  142.    extern IFFP Seek(/* BPTR, LONG, LONG */);
  143. or a "typedef" statement like this:
  144.    typedef IFFP ClientProc(/* struct _GroupContext * */);
  145. Don't remove the parentheses!
  146.  
  147. The header file COMPILER.H defines macros to isolate the compiler
  148. dependencies. The macro FDwAT ("function definitions with argument
  149. types") switches on/off the argument type declarations in the header files
  150. in this directory.
  151.  
  152.  
  153. 4. RemAlloc subroutines.
  154.  
  155. The "REMembering ALLOCator" is a useful little subroutine package included
  156. here. It saves you from having to remember the size of each node you
  157. allocate. (Why doesn't the Amiga allocator do this?)
  158.  
  159.  
  160. 5. Optional buffered file I/O package GIO.
  161.  
  162. Amiga file I/O can be greatly sped up by use of a RAM buffer. So we now have
  163. a layer of software that provides optional buffering. The "option" is
  164. controlled by changing a "#define" inside the header file GIO.H, adding
  165. GIO.O to your link file, recompiling, and recompiling. When turned off,
  166. this layer becomes just a layer of macro calls between the IFFR and IFFW
  167. modules and the AmigaDOS routines they call.
  168.  
  169. This RAM buffer speeds things up when you're doing numerous small Writes
  170. and/or Seeks while writing. The general IFF writer IFFW.C tends to do this.
  171. It should be extended to optimize reading, too.
  172.  
  173. If you are not using IFF, and already Write in chunks of 256 bytes or more,
  174. don't bother using GIO.
  175.  
  176.